package ru.arriah.servicedesk.bean;

import java.sql.ResultSet;
import java.sql.SQLException;

import ru.arriah.common.bean.GenericBean;

public class OrganizationBean extends GenericBean {

   private String shortTitle;
   private String fullTitle;
   private String postalAddress;
   private String kpp;
   private String inn;
   private String settlementAccount;
   private String bankTitle;
   private String corrAccount;
   private String bik;
   private String tel1;
   private String tel2;
   private String fax;
   private String email1;
   private String email2;
   private String www;
   private String notes;
   private String businessType;
   private String status;
   
   public OrganizationBean() {
      super();
   }
   
   public OrganizationBean(ResultSet resultSet) {
      fillFromResultSet(resultSet);
   }
   
   @Override
   public void fillFromResultSet(ResultSet resultSet) {
      // TODO Auto-generated method stub
      try {
         setId(resultSet.getInt("organization.id"));
         setShortTitle(resultSet.getString("organization.shorttitle"));
         setFullTitle(resultSet.getString("organization.fulltitle"));
         setPostalAddress(resultSet.getString("organization.postaladdress"));
         setKpp(resultSet.getString("organization.kpp"));
         setInn(resultSet.getString("organization.inn"));
         setSettlementAccount(resultSet.getString("organization.settlementaccount"));
         setBankTitle(resultSet.getString("organization.banktitle"));
         setCorrAccount(resultSet.getString("organization.corraccount"));
         setBik(resultSet.getString("organization.bik"));
         setTel1(resultSet.getString("organization.tel1"));
         setTel2(resultSet.getString("organization.tel2"));
         setFax(resultSet.getString("organization.fax"));
         setEmail1(resultSet.getString("organization.email1"));
         setEmail2(resultSet.getString("organization.email2"));
         setWww(resultSet.getString("organization.www"));
         setNotes(resultSet.getString("organization.notes"));
         setBusinessType(resultSet.getString("organization.businesstype"));
         setStatus(resultSet.getString("organization.status"));
      } catch (SQLException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }
   }
   
   public String getStatus() {
      return status;
   }

   public void setStatus(String status) {
      this.status = status;
   }

   public boolean isValid() {
      return true;
   }

   public String getBankTitle() {
      return bankTitle;
   }

   public void setBankTitle(String bankTitle) {
      this.bankTitle = bankTitle;
   }

   public String getBik() {
      return bik;
   }

   public void setBik(String bik) {
      this.bik = bik;
   }

   public String getBusinessType() {
      return businessType;
   }

   public void setBusinessType(String businessType) {
      this.businessType = businessType;
   }

   public String getCorrAccount() {
      return corrAccount;
   }

   public void setCorrAccount(String corrAccount) {
      this.corrAccount = corrAccount;
   }

   public String getEmail1() {
      return email1;
   }

   public void setEmail1(String email1) {
      this.email1 = email1;
   }

   public String getEmail2() {
      return email2;
   }

   public void setEmail2(String email2) {
      this.email2 = email2;
   }

   public String getFax() {
      return fax;
   }

   public void setFax(String fax) {
      this.fax = fax;
   }

   public String getFullTitle() {
      return fullTitle;
   }

   public void setFullTitle(String fullTitle) {
      this.fullTitle = fullTitle;
   }

   public String getInn() {
      return inn;
   }

   public void setInn(String inn) {
      this.inn = inn;
   }

   public String getKpp() {
      return kpp;
   }

   public void setKpp(String kpp) {
      this.kpp = kpp;
   }

   public String getNotes() {
      return notes;
   }

   public void setNotes(String notes) {
      this.notes = notes;
   }

   public String getPostalAddress() {
      return postalAddress;
   }

   public void setPostalAddress(String postalAddress) {
      this.postalAddress = postalAddress;
   }

   public String getSettlementAccount() {
      return settlementAccount;
   }

   public void setSettlementAccount(String settlementAccount) {
      this.settlementAccount = settlementAccount;
   }

   public String getShortTitle() {
      return shortTitle;
   }

   public void setShortTitle(String shortTitle) {
      this.shortTitle = shortTitle;
   }

   public String getTel1() {
      return tel1;
   }

   public void setTel1(String tel1) {
      this.tel1 = tel1;
   }

   public String getTel2() {
      return tel2;
   }

   public void setTel2(String tel2) {
      this.tel2 = tel2;
   }

   public String getWww() {
      return www;
   }

   public void setWww(String www) {
      this.www = www;
   }
}